<template>
    <div class="userinfo">
        <nav-bar/>
        <img src="@/assets/bannerTop_new.png" alt="" class="backImg">
        <user-detail :userInfo="model"/>
        <user-article />
    </div>
  </template>

<script>
import NavBar from './components/Navbar.vue'
import userDetail from './components/userDetail'
import userArticle from './components/userArticle'
import axios from 'axios'
export default {
  data () {
    return {
      model: {}
    }
  },
  components: {
    NavBar,
    userDetail,
    userArticle
  },
  methods: {
    async userData () {
      const res = await axios.get('http://localhost:3000/user/' + localStorage.getItem('id'))
      console.log(res.data.data)
      this.model = res.data.data[0]
    }
  },
  created () {
    this.userData()
  }
}
</script>

  <style lang="less">
  .userinfo{
  .backImg{
      height: 91px;
      width: 100%;
  }
  }
  </style>
